import 'package:flutter/material.dart';
import 'package:flutter_ability/custom_ui.dart';

class ImageCustomPage extends StatefulWidget {
  const ImageCustomPage({Key? key}) : super(key: key);

  @override
  State<ImageCustomPage> createState() => _ImageCustomPageState();
}

class _ImageCustomPageState extends State<ImageCustomPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: YJAppBar(
        isScaffold: true,
        leadingType: YJAppBarType.back,
        title: TextView.text("Image 图片自定义"),
        backgroundColor: YJColors.WHITE,
      ),
      backgroundColor: YJColors.WHITE,
      body: buildContainer2(),
    );
  }

  Widget buildContainer2() {
    return Container(
      margin: const EdgeInsets.symmetric(horizontal: 16),
      child: SingleChildScrollView(
          child:
              Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
        TextView.text("默认矩形"),
        const YJImageOverlay(
          width: 150,
          height: 120,
          image: AssetImage('assets/icon_no_gift_pack.png'),
        ),
        TextView.text("圆形"),
        const YJImageOverlay(
          width: 150,
          height: 120,
          image: AssetImage('assets/icon_no_gift_pack.png'),
          shape: BoxShape.circle,
        ),
        TextView.text("带圆角的矩形"),
        const YJImageOverlay(
            width: 150,
            height: 120,
            image: AssetImage('assets/icon_no_gift_pack.png'),
            borderRadius: BorderRadius.all(Radius.circular(20))),
      ])),
    );
  }
}
